package com.ooho.homework05;

import com.ooho.homework05.bean.MyBean;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * Created by hugohoo on 10/11/16.
 */
public class Serv extends HttpServlet {

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
//        super.doGet(req, resp);
        MyBean mybean = new MyBean();
        mybean.setUsername("ooho");
        mybean.setAge(233);

        req.setAttribute("userInfo", mybean);
        getServletContext().getRequestDispatcher("/homework05/index.jsp").forward(req, resp);
    }
}
